﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Model;
using Bll;
using Newtonsoft.Json;

namespace WebApiServer.Controllers
{
    public class ReMenuController : ApiController
    {


        ReMenuBLL bll = new ReMenuBLL();

        #region 推荐套餐显示
        /// <summary>
        /// 推荐套餐显示
        /// </summary>     
        /// <returns></returns>

        [HttpPost]
        public string PostReMenushow()
        {
            return JsonConvert.SerializeObject(bll.ReMenushow());

        }
        #endregion

        #region 管理员显示
        public List<ReMenu> GetReshow()
        {
            return bll.ReMenushow();

        }
        #endregion

        #region 添加推荐套餐
        //添加推荐套餐
        public int GetAddReMenu(int Reid, string Rename, string Rephoto, string Redescrib, int Reprice)
        {
            if (bll.AddReMenu(Reid, Rename, Rephoto, Redescrib, Reprice) > 0)
            {
                return 1;
            }
            else
            {
                return 0;           
            }
        }
        #endregion

        #region 删除推荐套餐
        /// <summary>
        /// 删除推荐套餐
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int GetdelReMenu()
        {
            return bll.delReMenu();
        }
        #endregion

    }
}
